package com.atguigu.userprofile.dao;

import com.atguigu.userprofile.MysqlUtil.MysqlUtil;
import com.atguigu.userprofile.bean.TaskTagRule;
import java.util.List;

public class TaskTagRuleDao {
    public static void main(String[] args) {
        List<TaskTagRule> taskTagRules = selectTaskTagRulesByTaskId("1");
        taskTagRules.forEach(System.out::println);
    }

    public static List<TaskTagRule> selectTaskTagRulesByTaskId(String taskId){
        String querysql="SELECT tr.id,tr.tag_id,tr.task_id,tr.query_value,tr.sub_tag_id,ti.tag_name AS sub_Tag_Value FROM " +
                "task_tag_rule tr join tag_info ti on tr.sub_tag_id=ti.id where tr.task_id="+taskId;
        List<TaskTagRule> selectlist = MysqlUtil.selectlist(querysql, TaskTagRule.class, true);
        return selectlist;
    }
}
